package com.hky.dubbo.controller;

import com.hky.dubbo.api.service.DemoService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DemoController {
    // 调用暴露的接口
    @DubboReference(interfaceClass = DemoService.class,version = "1.0.0",check = false)
    private DemoService demoService;

    @GetMapping("/demo")
    public String getDemo(){
        System.out.println("调用了dubbo");
        String res = demoService.sayHello("hankeyan");
        return res;
    }
}
